///-----------------------------------------------------------------
///
/// @file      D-DrawFrm.h
/// @author    -
/// Created:   06.04.2014 10:45:02
/// @section   DESCRIPTION
///            D_DrawFrm class declaration
///
///------------------------------------------------------------------

#ifndef __D_DRAWFRM_H__
#define __D_DRAWFRM_H__

#ifdef __BORLANDC__
	#pragma hdrstop
#endif

#ifndef WX_PRECOMP
	#include <wx/wx.h>
	#include <wx/frame.h>
#else
	#include <wx/wxprec.h>
#endif

//Do not add custom headers between 
//Header Include Start and Header Include End.
//wxDev-C++ designer will remove them. Add custom headers after the block.
////Header Include Start
#include <wx/menu.h>
#include <wx/toolbar.h>
#include <wx/statusbr.h>
////Header Include End

#include <wx/mdi.h>
#include "GuiCommandProcessor\GuiCommandProcessor.h"
#include "ProjectManagement\ProjectManager.h"
#include "CreateProjectFrm.h"

////Dialog Style Start
#undef D_DrawFrm_STYLE
#define D_DrawFrm_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLOSE_BOX
////Dialog Style End

class SlaveFrame;
class RenderManager;
class GuiUpdateManager;
class wxMiniFrame;
class ElementToolFactory;
class FileOutputManager;
		
class D_DrawFrm : public wxMDIParentFrame
{
	private:
		void Mnuclose1011Click(wxCommandEvent& event);
		void Mnunew1007Click(wxCommandEvent& event);
		DECLARE_EVENT_TABLE();
		
	public:
		D_DrawFrm(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("D-Draw"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = D_DrawFrm_STYLE);
		virtual ~D_DrawFrm();
		
	private:
		//Do not add custom control declarations between
		//GUI Control Declaration Start and GUI Control Declaration End.
		//wxDev-C++ will remove them. Add custom code after the block.
		////GUI Control Declaration Start
		wxMenuBar *WxMenuBar1;
		wxToolBar *WxToolBar1;
		wxStatusBar *WxStatusBar1;
		////GUI Control Declaration End
		
	private:
		//Note: if you receive any error with these enum IDs, then you need to
		//change your old form code that are based on the #define control IDs.
		//#defines may replace a numeric value for the enum names.
		//Try copy and pasting the below block in your old form header files.
		enum
		{
			////GUI Enum Control ID Start
			ID_MNU_FILE_1004 = 1004,
			ID_MNU_OPEN_1006 = 1006,
			ID_MNU_NEW_1007 = 1007,
			ID_MNU_CLOSE_1008 = 1008,
			ID_MNU_SAVE_1009 = 1009,
			ID_MNU_SAVEAS____1010 = 1010,
			ID_MNU_SUBMENUITEM8_1017 = 1017,
			ID_MNU_CLOSE_1011 = 1011,
			
			ID_WXTOOLBUTTON4 = 1015,
			ID_WXTOOLBUTTON3 = 1014,
			ID_WXTOOLBUTTON2 = 1013,
			ID_WXTOOLBUTTON5 = 1016,
			ID_WXTOOLBUTTON1 = 1012,
			ID_WXTOOLBAR1 = 1004,
			ID_WXSTATUSBAR1 = 1003,
			////GUI Enum Control ID End
			ID_MNU_ABOUT_1012 = 7012,
			ID_MNU_INFO_1013 = 7013,
			ID_MNU_USEDOTRENDERING_1021 = 7014,
			
			ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
		};
		
	private:
		void OnClose(wxCloseEvent& event);
		void CreateGUIControls();
		GuiCommandProcessor* m_command_processor;
		ProjectManager* m_project_manager;
		CreateProjectFrm* m_new_prj_frm;
		SlaveFrame* m_slave_frm;
		RenderManager* m_render_manager;
		GuiUpdateManager* m_gui_update_manager;
		wxMiniFrame* m_tool_frm;
		wxMiniFrame* m_tool_box_frm;
		ElementToolFactory* m_tool_factory;
		wxMenu* m_rendering_menu;
		FileOutputManager* m_output_manager;
	public:
		void DestroyFrm();
		bool ShowSaveProjectDialog();
		void AppendToTitle(wxString name);
		void RemoveSlaveFrame();
		void CreateSlaveFrame();
		SlaveFrame* GetSlaveFrame();
		void MouseClickOnSlave(void* data);
		void Mnuclose1008Click(wxCommandEvent& event);
		void Mnusave1009Click(wxCommandEvent& event);
		void Mnuopen1006Click(wxCommandEvent& event);
		void Mnusaveas1010Click(wxCommandEvent& event);
		ProjectManager* GetProjectManager();
		void Mnuinfo1013Click(wxCommandEvent& event);
		GuiCommandProcessor* GetCommandProcessor();
		GuiUpdateManager* GetGuiUpdateManager();
		RenderManager* GetRenderManager();
		void Mnuabout1012Click(wxCommandEvent& event);
		void D_DrawFrmLeftUP(wxMouseEvent& event);
		void D_DrawFrmIdle(wxIdleEvent& event);
		void D_DrawFrmActivate(wxActivateEvent& event);
		void D_DrawFrmPaint(wxPaintEvent& event);
		void AddRectangle(wxCommandEvent& event);
		void OnLeftClick(wxMouseEvent& event);
		void WxToolButton2Click(wxCommandEvent& event);
		wxPoint& GetRenderOffset();
		void PostMousePosition(wxPoint position);
		void ProjectPassive();
		void ProjectActive();
		void DisableSelectionTools();
		void EnableSelectionTools();
		void ClearToolFrameHandle();
		void ClearToolBoxFrameHandle();
		void WxToolButton4Click(wxCommandEvent& event);
		void AddTextRectangle(wxCommandEvent& event);
		void WxToolButton3Click(wxCommandEvent& event);
		void Mnuusedotrendering1021Click(wxCommandEvent& event);
		void StartNormalBridge(wxCommandEvent& event);
		void StartNormalDashedBridge(wxCommandEvent& event);
		void StartRawBridge(wxCommandEvent& event);
		void StartRawDashedBridge(wxCommandEvent& event);
		void AddLabel(wxCommandEvent& event);
		void AddEllipse(wxCommandEvent& event);
		void AddTextEllipse(wxCommandEvent& event);
		void AddDiamond(wxCommandEvent& event);
		void AddTextDiamond(wxCommandEvent& event);
		void WxToolButton1Click0(wxCommandEvent& event);
		void WxToolButton5Click0(wxCommandEvent& event);
		void Mnusubmenuitem81017Click(wxCommandEvent& event);
		void ExportProject(wxString file_name);
};

#endif
